import Vue from 'vue'
import Router from 'vue-router'
import Team from "../components/Team"
import TeamMember from "../components/TeamMember"
import PersonalInformation from "../components/PersonalInformation";
// import GameRecord from "../components/GameRecord";
import Login from "../components/login";
import TeamAll from "../components/TeamAll";
import GameRecordDetail from "../components/GameRecordDetail";
import FanGroup from "../components/FanGroup";
import FanGroupAll from "../components/FanGroupAll";

Vue.use(Router)

// 初始化路由
const routes = [
  {
    path: '',
    redirect: '/login'
  },
  {
    path: '/team/:teamname',
    name: 'Team',
    component: Team,
    meta: {
      title: '战队'
    }
  },
  {
    path: '/teammember/:membername',
    name: 'TeamMember',
    component: TeamMember,
    meta: {
      title: '队员'
    }
  },
  {
    path: '/gamerecorddetail/:gamerecordname',
    name: 'GameRecordDetail',
    component: GameRecordDetail,
    meta: {
      title: '比赛记录'
    }
  },
  {
    path: '/fangroup/:fangroupname',
    name: 'FanGroup',
    component: FanGroup,
    meta: {
      title: '粉丝团'
    }
  },
  {
    path: '/personalinformation',
    name: 'PersonalInformation',
    component: PersonalInformation
  },
  // {
  //   path: '/gamerecord',
  //   name: 'GameRecord',
  //   component: GameRecord
  // },
  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/teamall',
    name: 'TeamAll',
    component: TeamAll
  },
  {
    path: '/fangroupall',
    name: 'FanGroupAll',
    component: FanGroupAll
  }
]

//动态加载路由
//admin
//vip
export const DynamicRoutes = [
  {
    path: '',
    name: '',
    component: '',
    redirect: '',
    meta: {
      requiresAuth: true,
      name: '首页'
    }
  }
]

const router = new Router({
  routes,
  mode: "history"
})

export default router
